package cn.wolfcode.trip.app.controller;

import cn.wolfcode.trip.base.util.QiniuCloudUtil;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/images")
public class  ImageController {
    @PostMapping
    public Object uploadImage(MultipartFile pic){
        String url = QiniuCloudUtil.uploadQiniu(pic);
        Map<String,Object> map = new HashMap<>();
        map.put("url",url);
        map.put("status",1);
        return map;
    }

}
